{template 'header-company'}
<!--当前位置-->
<div class="location layout960">
	当前位置: <a href="{SITE_URL}">首页</a>&nbsp;»&nbsp; <a href="{url('company/index')}">企业库</a>
</div>
<!--当前位置 end-->
<div class="main layout960">
	<form id="createdocForm" name="baike-form" method="post" class="jqeditor">
		<input type="hidden" name='id' id="did" value="{$id}"/>
		<input type="hidden" name='title' value="{$title}"/>

		<select name="cates[]" multiple="multiple" id="cates" size="2" style="display: none;">
			{loop $cates $t}
			<option id="{$t}" value="{$t}" selected="selected"></option>
			{/loop}
		</select>

		<input type="hidden" name='summary' value="{$summary}"/>
		<input type="hidden" name='com_thumb' value="{$company_thumb}"/>

		<input type="hidden" name='com_type' value="{$company_type}"/>
		<input type="hidden" name='com_size' value="{$company_size}"/>
		<input type="hidden" name='com_year' value="{$company_year}"/>
		<input type="hidden" name='com_unit' value="{$company_unit}"/>
		<input type="hidden" name='com_money' value="{$company_money}"/>
		<input type="hidden" name='com_areaid' value="{$company_areaid}"/>
		<input type="hidden" name='com_address' value="{$company_address}"/>

		<input type="hidden" name='com_contact' value="{$company_contact}"/>
		<input type="hidden" name='com_telephone' value="{$company_telephone}"/>
		<input type="hidden" name='com_mail' value="{$company_mail}"/>
		<input type="hidden" name='com_business' value="{$company_business}"/>


		<div style="margin-bottom:10px;">
			<div class="jqe-toolbar" style="margin:2px 0; height: 33px;"></div>
		</div>

		<div id="text" class="bd editor-box">
			<h2>您正在编辑：{$title} - {$subtitles[$tid]}</h2>
			<div class="cat-list fn-clear">
				{loop $defaultDoc $k $v}
				<div id="cat{$k}" class="defaultCat cat-item fn-left fn-clear">
					<a class="jsCatOper add-cat fn-left" href="#" title="添加类目" onclick="return false"></a>
					<a class="goto-cat fn-left" href="#" onclick="return false">{$v}</a>
				</div>
				{/loop}

				<div class="add-new fn-left">
					<input id="add-new-ipt" type="text" value="输入新类目名称" size="15">
					<button type="button" id="add-new-btn">添加</button>
				</div>
			</div>
			<input id="curEditId" type="hidden" value="cat{$tid}" >
			<textarea id="editor" name="content" style="visibility:hidden;">{$content}</textarea>
			<input id="editorParam" type="hidden" value="25,1,xddlmaster,1,1">
		</div>

		<div id="reason" class="bd editor-box">
			<h2>修改原因<span class="red">[必填]</span></h2>
			<div>
				<label><input type="radio" value="全文编辑" checked="checked" name="reason"/>全文编辑</label>
				<label><input type="radio" value="新增内容" name="reason"/>新增内容</label>
				<label><input type="radio" value="修正错误" name="reason"/>修正错误</label>
				<label><input type="radio" value="新增图片" name="reason"/>新增图片</label>
				<label><input type="radio" value="设置目录" name="reason"/>设置目录</label>
				<label><input type="radio" value="增加内链" name="reason"/>增加内链</label>
				<label><input type="radio" value="调整页面" name="reason"/>调整页面</label>
			</div>
		</div>
		<div class="pushbutton">
			<input name="submit" class="conserve" type="submit" value="发布"/>
			<input id="abort-edit" type="button" value="退出"/>
		</div>
	</form>
</div>
<script>
	seajs.use(['editor','easyui','easyui-css','easyui-icon-css'], function () {
		$.extend($.fn.validatebox.defaults.rules, {
			fixLength: {
				validator: function(value, param){
					return value.length == param[0]&& $.isNumeric(value);
				},
				message: '请输入{0}位数年份'
			},
			comMoney:{
				validator: function(value, param){
					return $.isNumeric(value) && value>param[0];
				},
				message: '请输入大于0的注册资本'
			},
			comSize:{
				validator: function(value){
					return $.isNumeric(value);
				},
				message: '请选择公司规模'
			},
			comType:{
				validator: function(value){
					return $.isNumeric(value);
				},
				message: '请选择公司类型'
			}
		});
		$("#com_year").validatebox({
			required:true,
			validType:['fixLength[4]'],
			missingMessage:'请填写注册年份'
		});
		$('select[name="com_type"]').validatebox({
			required:true,
			missingMessage:'请选择企业类型'
		});
		$('#com_money').validatebox({
			required:true,
			validType:['comMoney[0]'],
			missingMessage:'请填写注册资金'
		});
		$('select[name="com_size"]').validatebox({
			required:true,
			validType:['comSize'],
			missingMessage:'请选择公司规模'
		});
		$('select[name="com_type"]').validatebox({
			required:true,
			validType:['comType'],
			missingMessage:'选择公司类型'
		});
		$('#createdocForm').submit(function(){
			return $(this).form('validate');
		});
	})

	seajs.use(['mod-editor'],function(Editor){
		var comEditor = new Editor("#editor"),eParam = $("#editorParam").val();
		comEditor.init(eParam);
		comEditor.run();
	});
</script>
<!--主体部分 end-->
{template 'footer'}